export function transformDate (date: Date) {
  return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
}
export function transformDateTo (date: string) {
  const arr = date.split('-');
  return new Date(Number(arr[0]), Number(arr[1]) - 1, Number(arr[2]));
}
export function createUserByTime (user:{name:string, age:number}) {
  const date = new Date();
  const year = date.getFullYear();
  const month = date.getMonth() + 1;
  const day = date.getDate();
  const hour = date.getHours();
  const minute = date.getMinutes();
  const second = date.getSeconds();
  const millisecond = date.getMilliseconds();
  const time = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  const userId = `${user.name}-${time}-${millisecond}`;
  return {
    ...user,
    id: userId,
    createTime: time,
    updateTime: time,
    isDelete: false,
    isActive: true,
    isLock: false,
    isVerify: false
  };
}
